Test Series - computer fundamental

Test Number 60/95

Q: Multithreading is also called as ____________
A. Concurrency
B. Simultaneity
C. Crosscurrent
D. Recurrent
Solution: Concurrency is often used in place of multithreading. Multitasking allows multiple threads to run at a time.
Q: Multiprocessing allows single processor to run several concurrent threads.
A. True
B. False
C. none
D. .
Solution: The statement is false. Multitasking allows single processor to run several concurrent threads.
Q: A single sequential flow of control within a program is ________
A. Process
B. Task
C. Thread
D. Structure
Solution: A thread is a sequential flow of control within a program. Single-threaded program can handle one task at any time.
Q: Both client and server release _________ connection after a page has been transferred.
A. IP
B. TCP
C. Hyperlink
D. Network
Solution: The answer is TCP. TCP stands for Transmission Control Protocol. Servers receive requests from clients.
Q: Java extension used in threads?
A. java.lang.Thread
B. java.language.Thread
C. java.lang.Threads
D. java.Thread
Solution: java.lang.Thread is the class that is extended if any user wants to extend threads.
Q: A method that must be overridden while extending threads.
A. run()
B. start()
C. stop()
D. paint()
Solution: run()method must be overridden (It is similar to main method of sequential program).
Q: An interface that is implemented while using threads.
A. java.lang.Run
B. java.lang.Runnable
C. java.lang.Thread
D. java.lang.Threads
Solution: java.lang.Runnable is correct. Any thread class implements runnable.
Q: A thread becomes non runnable when?
A. Its stop method is invoked
B. Its sleep method is invoked
C. Its finish method is invoked
D. Its init method is invoked
Solution: A thread becomes Not Runnable when one of these events occurs:
• Its sleep method is invoked.
• The thread calls the wait method to wait for a specific condition to be satisfied.
• The thread is blocking on I/O.
Q: A method used to temporarily release time for other threads.
A. yield()
B. set()
C. release()
D. start()
Solution: We can use the yield() method to temporarily release time for other threads. It is static by default.
Q: A method used to force one thread to wait for another thread to finish.
A. join()
B. connect()
C. combine()
D. concat()
Solution: The answer is join(). We can use the join() method to force one thread to wait for another thread to finish.

You Have Score    /10